from wordcloud import WordCloud
f = open('西游记。txt','r').read()
font_path = '华康黑体_W3.TTF'
cloud = WordCloud(font_path = font_path).generate(f)
cloud.to_file('西游记.jpg')